package com.example.demo.member.controller;

import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
public class MemberController {

    @Autowired
    private Environment environment;

    @GetMapping("/test")
    public String test() {
        String port = environment.getProperty("local.server.port");
        String string = "[member], port: " + port + ", time: " + LocalDateTime.now();
        System.out.println(string);
        return string;
    }

}
